import moment from 'moment'
/**
 * 全局 filter 方法
 * @returns []
 * @params: name: String
 * @params: func: Function
 */
export default [
  {
    name: 'changeStringArray',
    func: (v) => {
      return window.$tools.changeStringArray(v)
    }
  }, {
    name: 'formatTime',
    func: v => {
      const date = new Date(v)
      return moment(date).format('YYYY:MM:DD hh:mm:ss')
    }
  }, {
    name: 'filterPrice',
    func: v => {
      return window.$tools.filterPrice(v)
    }
  }, {
    name: 'filterStringTime',
    func: v => {
      const date = new Date(parseInt(v + '000', 10))
      return moment(date).format('YYYY:MM:DD hh:mm:ss')
    }
  }
]
